home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / utility / horst_2.zip / LISTMOD.DOC < prev    next >
Text File  |  1995-12-18  |  3KB  |  82 lines

  1. ------------------------------------------------------------------------
  2. LISTMOD   list utility                  Ver 1.2 (c) 1994 Horst Schaeffer
  3. ------------------------------------------------------------------------
  4.  
  5. LISTMOD generates an output list (to STDOUT) using data from a given
  6. input list (STDIN) - line by line.
  7.  
  8. Syntax:  LISTMOD [options] string < input.txt > output.txt
  9.  
  10. The string is written into each output line, where $1...$99 are tokens
  11. referring to the 1st....99th word of the input line.
  12.  
  13. If, for example, you want to execute: COPY <file> A:
  14. for each file name in a given list, LISTMOD will generate a COPY
  15. instruction for each file name and write it into a batch file.
  16.  
  17.     listmod COPY $1 A: < input.lst > TMP.BAT
  18.     ::      ==========
  19.     call TMP.BAT
  20.  
  21. The file names are inserted by token $1 referring to the 1st (and only)
  22. word of each input line.
  23.  
  24.  
  25. Variables and other symbols
  26. ---------------------------
  27.     $1..$99   refers to the n-th word of the input line
  28.     $0        the complete input line
  29.     $*        same as $0
  30.     $( $! $)  converts to: < | >
  31.     $#        generates the 3-digit line number (see option /N)
  32.     $$        $
  33.     $L        generates a carriage return / line feed.
  34.               (more than 1 line may be produced from each input line)
  35.  
  36. Options
  37. -------
  38. Options must be placed before the string.
  39.     /S...     Separators (see below)
  40.     /Nnnn     starting number for $# count (default is 001)
  41.  
  42.  
  43. Separators (option /S)
  44. ----------------------
  45. "Words" of an input line are separated by blank, comma, semicolon
  46. or equal sign. These delimiters are never copied to output lines.
  47.  
  48. Additional separators may be defined with the /S option followed
  49. by one or more symbols (terminated by a space).
  50.  
  51. Example:  delete the 5th character from each *.DAT file name
  52.           (in the current directory)
  53.  
  54.     ren *.DAT ????#???.DAT
  55.     dir *.DAT /B/A-D | LISTMOD /S# ren $1#$2 $1$2 > TMP.BAT
  56.     ::                         ^^^ ==============
  57.     call TMP.BAT
  58.  
  59. First the 5th character is replaced by "#" (REN).
  60. Then a directory listing is piped into LISTMOD, where the "#"
  61. is defined as an additional separator, dividing the file names
  62. into $1 (????) and $2 (???.DAT).
  63.  
  64.  
  65. Notes
  66. -----
  67. The input file is limited to 60 KB. The output file is not limited,
  68. but the output line size must not exceed 1 KB.
  69.  
  70. For execution under MS-DOS a command line or any line in the resulting
  71. batch file must not exceed 127 bytes.
  72.  
  73. If no input file is given LISTMOD shows a brief help information.
  74.  
  75. To avoid conflicts when numeric data occur in the string, you
  76. may use e.g. $01 instead of $1 (because only 2 digits are read):
  77.  
  78.     $15         is the 15th word
  79.     $015        is the 1st word succeeded by constant "5"
  80.  
  81. * 13 FEB 1994
  82.